package com.hubei.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@ApiModel(value="优惠券")
@Data
@Accessors(chain = true) //开启链写编程
@TableName(value = "ms_coupon")
public class MsCoupon {

    /**
     * 优惠券主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value="优惠券主键id")
    private Long id;

    /**
     * 枚举类型(数值)
     */
    @TableField("enumtype")
    @ApiModelProperty(value = "枚举类型(数值)",example = "券枚举  0 优惠券 1 团购券 2礼品券")
    private Integer enumtype;

    /**
     * 枚举类型(字符串)
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "枚举类型(字符串)",example = "券枚举  0 优惠券 1 团购券 2礼品券", hidden = true)
    private String enumtypeString;

    /**
     * 券抵扣金额
     */
    @TableField("price")
    @ApiModelProperty(value = "券抵扣金额")
    private BigDecimal price;

    /**
     * 使用条件
     */
    @TableField(value = "`condition`")
    @ApiModelProperty(value="使用条件",example = "只能用于小型货车")
    private String condition;

    /**
     * 开始时间
     */
    @TableField(value = "begindate")
    @ApiModelProperty(value = "开始时间", example = "2019-11-29 15:28:36")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime begindate;

    /**
     * 结束时间
     */
    @TableField(value = "enddate")
    @ApiModelProperty(value = "结束时间", example = "2019-11-29 15:28:36")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime enddate;

    /**
     * 是否禁用
     */
    @TableField(value = "isstop")
    @ApiModelProperty(value="是否禁用")
    private Boolean isstop;
}
